package cn.wolfcode.enums;

import lombok.Getter;

@Getter
public enum AppointmentEnums {

    PEND("待确认",0),
    PERFORM("履行中",1),
    CONSUME("消费中",2),
    FINISH("归档",3),
    FAILURE("废弃",4);

    private String name;
    private Integer value;
    AppointmentEnums(String name, Integer value) {
        this.name=name;
        this.value = value;
    }

    public static String findName(Integer value){
        AppointmentEnums[] enums = values();
        for (AppointmentEnums appointmentEnum : enums){
            if (appointmentEnum.getValue().equals(value)){
                return appointmentEnum.getName();
            }
        }
        return null;
    }
}
